﻿Imports Castle.ActiveRecord
Imports NHibernate
Imports NHibernate.Criterion

Namespace Model

    ''' <summary>
    '''	Criado em 21/08/2010 16:13:00
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable(), ActiveRecord("endereco", DynamicUpdate:=True)> _
    Public Class Endereco
        Inherits ActiveRecordBase(Of Model.Endereco)

        Private _cd_endereco As Integer
        Private _endereco_rua As String
        Private _endereco_numero As String
        Private _endereco_bairro As String
        Private _endereco_cep As String
        Private _endereco_cidade As String
        Private _endereco_complemento As String

        Private _Pessoa As Model.Pessoa
        Private _Municipio As Model.Municipio
        Private _Estado As Model.Estado
        Private _Pais As Model.Pais


        <PrimaryKey(PrimaryKeyType.Sequence, SequenceName:="endereco_cd_endereco_seq")> _
        Public Property cd_endereco() As Integer
            Get
                Return _cd_endereco
            End Get
            Set(ByVal value As Integer)
                _cd_endereco = value
            End Set
        End Property

        <BelongsTo("cd_pessoa", NotNull:=True)> _
        Public Property Pessoa() As Model.Pessoa
            Get
                Return _Pessoa
            End Get
            Set(ByVal value As Model.Pessoa)
                _Pessoa = value
            End Set
        End Property

        <BelongsTo("cd_pais")> _
        Public Property Pais() As Model.Pais
            Get
                Return _Pais
            End Get
            Set(ByVal value As Model.Pais)
                _Pais = value
            End Set
        End Property

        <BelongsTo("cd_estado")> _
        Public Property Estado() As Model.Estado
            Get
                Return _Estado
            End Get
            Set(ByVal value As Model.Estado)
                _Estado = value
            End Set
        End Property

        <BelongsTo("cd_municipio")> _
        Public Property Municipio() As Model.Municipio
            Get
                Return _Municipio
            End Get
            Set(ByVal value As Model.Municipio)
                _Municipio = value
            End Set
        End Property


        <[Property]("endereco_rua")> _
        Public Property endereco_rua() As String
            Get
                Return _endereco_rua
            End Get
            Set(ByVal value As String)
                _endereco_rua = value
            End Set
        End Property

        <[Property]("endereco_numero")> _
        Public Property endereco_numero() As String
            Get
                Return _endereco_numero
            End Get
            Set(ByVal value As String)
                _endereco_numero = value
            End Set
        End Property

        <[Property]("endereco_bairro")> _
        Public Property endereco_bairro() As String
            Get
                Return _endereco_bairro
            End Get
            Set(ByVal value As String)
                _endereco_bairro = value
            End Set
        End Property

        <[Property]("endereco_cep")> _
        Public Property endereco_cep() As String
            Get
                Return _endereco_cep
            End Get
            Set(ByVal value As String)
                _endereco_cep = value
            End Set
        End Property

        <[Property]("endereco_cidade")> _
         Public Property endereco_cidade() As String
            Get
                Return _endereco_cidade
            End Get
            Set(ByVal value As String)
                _endereco_cidade = value
            End Set
        End Property

        <[Property]("endereco_complemento")> _
        Public Property endereco_complemento() As String
            Get
                Return _endereco_complemento
            End Get
            Set(ByVal value As String)
                _endereco_complemento = value
            End Set
        End Property
    End Class

End Namespace